package io;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;

import entities.ClassRoom;


public class ClassRoomReader extends CSVReader {

	public ArrayList<ClassRoom> getEntries() throws FileNotFoundException, IOException {

		ArrayList<ArrayList<String>> csvContent = this.readFile("resources.csv");
		
		ArrayList<ClassRoom> timeTableEntries = new ArrayList<ClassRoom>();
		
		for(ArrayList<String> csvRow : csvContent) {
			ClassRoom t_resource_entry = new ClassRoom();
			t_resource_entry.set_roomNumber(csvRow.get(0));
			t_resource_entry.set_building(csvRow.get(1));
			t_resource_entry.set_capacity(Integer.parseInt(csvRow.get(2)));
			t_resource_entry.set_zone(csvRow.get(3));
			
			timeTableEntries.add(t_resource_entry);
		}
		
		return timeTableEntries;
	}
	
}